package io;

import java.io.BufferedOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class FlushDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream file=new FileOutputStream("fos.txt");
        BufferedOutputStream bos=new BufferedOutputStream(file);
        String s="空天猎";
        byte[] date=s.getBytes(StandardCharsets.UTF_8);
        bos.write(date);
        bos.flush();
        System.out.println("写出完毕");
        bos.close();
    }
}
